package org.micro.rbac.dao.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 系统资源表
 * </p>
 *
 * @author HongSir
 * @since 2024-06-12
 */
@Getter
@Setter
@TableName("SYS_RESOURCE")
@Schema(name = "SysResource", description = "系统资源表")
public class SysResource implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @TableId("ID")
    private Long id;

    @Schema(description = "上级ID")
    @TableField("PID")
    private Long pid;

    @Schema(description = "资源名")
    @TableField("RESOURCE_NAME")
    private String resourceName;

    @Schema(description = "类型:1-菜单,2-接口,3-文件...")
    @TableField("RESOURCE_TYPE")
    private Integer resourceType;

    @Schema(description = "层级")
    @TableField("RESOURCE_LEVEL")
    private Integer resourceLevel;

    @Schema(description = "路径")
    @TableField("RESOURCE_PATH")
    private String resourcePath;

    @Schema(description = "图标")
    @TableField("RESOURCE_ICON")
    private String resourceIcon;

    @Schema(description = "所有上级ID,冗余字段")
    @TableField("MATCH_ID")
    private String matchId;

    @Schema(description = "排序")
    @TableField("SORT")
    private Integer sort;

    @Schema(description = "备注")
    @TableField("MEMO")
    private String memo;

    @Schema(description = "创建时间")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;
}
